fix(storage): Fix FileFeatureStorage path resolution on case-sensitive file systems#2082
fix(storage): Fix FileFeatureStorage path resolution on case-sensitive file systems#2082im-anishraj wants to merge 2 commits into
Conversation
…age (microsoft#2053) - Changed FileFeatureStorage.file_name to a property that checks for existing file paths. - Preserves case sensitivity for new files and existing uppercase directories. - Maintains backward compatibility for lowercase paths. - Added verification test case.
|
@microsoft-github-policy-service agree |
|
Hi @anish-devgit , Thank you so much for taking the time to contribute and for providing a thoughtful solution! We really appreciate your effort. In this case, Thanks again for the contribution and for offering to submit a PR — we really value the discussion and grateful for your understanding. |
|
Thanks a lot for the detailed explanation and for reviewing my PR 🙏 Appreciate the guidance and the kind feedback. Happy to contribute again in the future! |
Summary
Fixes #2053: FileFeatureStorage incorrectly lowercases instrument directory names, causing failures on case-sensitive file systems.
What I changed
qlib/data/storage/file_storage.pyto resolve instrument directories using the correct filesystem case when available.tests/storage_tests/test_issue_2053.pyto validate behavior on case-sensitive systems.How I tested
test_issue_2053.py) that reproduces the issue by creating an uppercase instrument directory.FileFeatureStorageresolves paths correctly after the fix.Before / After
Before
FileFeatureStorage(instrument="AAPL").uri→.../aapl/close.day.bin(fails if directory isAAPL)After
FileFeatureStorage(instrument="AAPL").uri→.../AAPL/close.day.binFixes #2053